<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title th:text="${'博客编辑:' + article.title}"></title>
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
    <link rel="stylesheet" th:href="@{/css/edit-article.css}">
    <script th:src="@{/layui/layui.js}"></script>
    <script th:src="@{/js/edit-article.js}"></script>
</head>
<header th:replace="header::header"></header>
<body class="layui-anim layui-anim-downbit">
<div class="layui-container">
    <blockquote class="layui-elem-quote">
        <i class="layui-icon layui-icon-edit"></i>&nbsp;正在编辑博客：<b th:text="${article.title}"></b>
    </blockquote>
    <form class="layui-form" th:action="@{/my-articles/edit-article/{articleUid}(articleUid = ${articleUid})}" method="post">
        <input type="hidden" name="createTime" th:value="${article.createTime}">
        <div class="layui-form-item">
            <label class="layui-form-label"><i class="layui-icon layui-icon-fonts-strong"></i>&nbsp;文章标题</label>
            <div class="layui-input-block">
                <input type="text" name="title" required placeholder="请输入标题" autocomplete="off"
                       class="layui-input title"
                       maxlength="30" th:value="${article.title}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><i class="layui-icon layui-icon-note"></i>&nbsp;分类</label>
            <div class="layui-input-inline">
                <select name="category" required>
                    <option th:each="cate : ${category}"
                            th:text="${cate.name}"
                            th:value="${cate.name}"
                            th:selected="${article.category == cate.name}"></option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><i class="layui-icon layui-icon-key"></i>&nbsp;关键词</label>
            <div class="layui-input-inline">
                <input type="text" name="keywords" required placeholder="请输入关键词" autocomplete="off"
                       class="layui-input keywords"
                       maxlength="20"
                       th:value="${article.keywords}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><i class="layui-icon layui-icon-face-smile-b"></i>&nbsp;对外开放</label>
            <div class="layui-input-block">
                <input type="checkbox" name="open" lay-skin="switch" th:checked="${article.open}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><i class="layui-icon layui-icon-dialogue"></i>&nbsp;开放评论</label>
            <div class="layui-input-block">
                <input type="checkbox" name="commentable" lay-skin="switch" th:checked="${article.open}">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label"><i class="layui-icon layui-icon-align-center"></i>&nbsp;博客内容</label>
            <div class="layui-input-block">
                <textarea name="content" id="content" placeholder="请输入内容"
                          class="layui-textarea" th:utext="${article.content}"
                          maxlength="10000"></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <input class="layui-btn" type="submit" value="提交修改">
            </div>
        </div>
    </form>
</div>
</body>
<footer th:replace="footer::footer"></footer>
</html>